#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	long long n,k;
	scanf("%I64d %I64d",&n,&k);
	long long m;
	m = n/2;
	if(n%2) m++;
	if(k<=m) printf("%I64d\n",k*2-1);
	else printf("%I64d\n",(k-m)*2); 
} 
